﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace XD
{
    class Program
    {
        public static String INPUT_FILE;
        public static String OUTPUT_FILE;
        public static List<ConsoleActionBase> Flags = new List<ConsoleActionBase>();
        static void Main(string[] args)
        {
            Flags.Add(new Flags.o());

            if (args.Length == 0) //The file has been opened manually, display error
            {
                Console.Title = "xD Compiler"; //Just for graphic purposes
                Console.WriteLine("xD Compiler");

                Console.WriteLine("Syntax: xD [input file] [flag] [output file]");
    
            }
            else
            {
                bool flagfound = false;
                for (int i = 0; i < Flags.Count; i++)
                {
                    if(Flags[i].flag == args[1]){
                        Flags[i].Execute(args);
                        flagfound = true;
                    }

                }
                if(!flagfound){
                    Console.WriteLine("The entered flag could not be found: " + args[1]);

                }
              

            }
        }
    }
}
